package com.amado.course13.zuoye;

public class StudentStudentManager {

	public static void main(String[] args) {
		// 学生
		Student[] studentArray = new Student[100];
		initStudent(studentArray);
		
		// 教师
		Teacher[] teacherArray = new Teacher[100];
		// 教师
		StudentTeacherRelation[] relationArray = initRelation();
	}

	public static void initStudent(Student[] studentArray) {
		Student student = new Student();
		student.age = 13;
		student.name = "张三";
		student.id = 1;

		Student student2 = new Student();
		student2.age = 13;
		student2.name = "张三";
		student2.id = 1;

		Student[] studentObjArray = new Student[100];
		studentObjArray[0] = student;
		studentObjArray[1] = student2;
	}

	public static StudentTeacherRelation[] initRelation() {
		StudentTeacherRelation[] relationArray =  new StudentTeacherRelation[100];
		StudentTeacherRelation student = new StudentTeacherRelation();
		student.teacherNum = "JX001";
		student.studentNum = "XY001";

		StudentTeacherRelation student2 = new StudentTeacherRelation();
		student.teacherNum = "JX002";
		student.studentNum = "XY001";

		relationArray[0] = student;
		relationArray[1] = student2;
		return relationArray;
	}

	public static void addStudent(Student[] studentArray) {

	}

	/**
	 * 判断是否存在关联关系
	 * 
	 * @param relationArray
	 *            教师与学员关联关系
	 * @param teacherNum
	 *            教师
	 * @param studentNum
	 * @return
	 */
	public static boolean isExistBandRelation(StudentTeacherRelation[] relationArray, String teacherNum,
			String studentNum) {
		for (StudentTeacherRelation relation : relationArray) {
			// XY001,JS001
			if (relation.studentNum.equals(studentNum) && relation.teacherNum.equals(teacherNum)) {
				return true;
			}
		}
		return false;
	}

}
